package com.dragonlance.scene;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map.Entry;

import com.dragonlance.DLClient;
import com.dragonlance.map.Map;
import com.dragonlance.net.PackageOut;
import com.dragonlance.net.out.BaseSceneOut;
import com.dragonlance.scene.item.Player;

public class BaseScene{
	private Map map;
	private int secenId;
	private int LivingId;
	private HashMap<Integer, Player> players;
	private HashMap<Long,DLClient> clients;
	protected BaseSceneOut out;
	public BaseScene(Map map){
		this.map = map;
		this.players = new HashMap<Integer, Player>();
		this.clients = new HashMap<Long, DLClient>();
		out = new BaseSceneOut(clients);
	}
	
	public void addPlayer(Player player){
		player.setSceneId(this.LivingId++);
		this.players.put(player.getSceneId(), player);
		out.sendEnterScene(player);
	}
	
	public void removePlayer(Player player){
		this.players.remove(player.getSceneId());
	}

	public int getSecenId() {
		return secenId;
	}

	public void setSecenId(int secenId) {
		this.secenId = secenId;
	}
}
